package com.hxm.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by HXM on 2017/1/16.
 * 描述：小技巧，不会因为点击了好多次而一直不停的弹Toast
 */

public class ToastUtil {
    private static Toast toast;

    public static void showToast(Context context,String content){
        if (toast==null){
            toast=Toast.makeText(context,content,Toast.LENGTH_SHORT);
        }else {
            toast.setText(content);
        }
        toast.show();
    }
}
